package com.codeoss.framework.view.parser;

import org.springframework.stereotype.Service;

import com.codeoss.framework.view.component.Component;
import com.codeoss.framework.view.component.DashboardPage;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

@Service("dashboardpageParser")
public class DashboardPageParser extends AbstractComponentParser {
	
	@Override
	protected void setAttributes(IParseContext parseContext, ObjectNode objectNode, Component component) {
		super.setAttributes(parseContext, objectNode, component);
		DashboardPage dashboardPage=(DashboardPage)component;
		JsonNode jsonNode=objectNode.get("refPageCode");
		if(jsonNode!=null && !jsonNode.asText().equals("null")) {
			dashboardPage.setRefPageCode(jsonNode.asText());
		}
	}

	@Override
	protected Component createComponent(IParseContext parseContext, ObjectNode objectNode) {
		// TODO Auto-generated method stub
		return new DashboardPage();
	}

}
